package com.atguigu.tingshu.album.api;


import com.atguigu.tingshu.common.minio.service.FileOpsService;
import com.atguigu.tingshu.common.result.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@Tag(name = "上传管理接口")
@RestController
@RequestMapping("api/album")
public class FileUploadApiController {



    @Autowired
    private FileOpsService fileOpsService;


    //Request URL: http://192.168.200.1:8500/api/album/fileUpload

    @PostMapping(value = "/fileUpload")
    @Operation(summary = "文件上传接口")
    public Result fileUpload(MultipartFile file) {

        String picUrl = fileOpsService.fileUpload(file);
        return Result.ok(picUrl);
    }


}
